package common;
import java.util.List;


public class Season {
	private int id;
	private List<Episode> episodes;	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public List<Episode> getEpisodes() {
		return episodes;
	}
	public void setEpisodes(List<Episode> episodes) {
		this.episodes = episodes;
	}
	
	public Episode getLastEpisode(){
		int index = getEpisodesCount() - 1;
		if(index < 0)
			return null;
		else
			return episodes.get(index);
	}
	
	public int getEpisodesCount(){
		if(haveEpisodes())
			return episodes.size();
		else
			return 0;
	}
	
	public boolean haveEpisodes(){
		return episodes != null && !episodes.isEmpty();
	}
}
